package com.wzy.business.room.database

import android.content.Context
import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
import com.wangzhenyu.common.base.bean.LoginInfo
import com.wangzhenyu.common.design.MySingleton
import com.wzy.business.room.bean.User
import com.wzy.business.room.dao.LoginInfoDao
import com.wzy.business.room.dao.UserDao
import com.wzy.business.store.main.bean.ShopStatus
import com.wzy.business.store.main.dao.ShopStatusDao

@Database(
    entities = [User::class, LoginInfo::class, ShopStatus::class],
    version = 1,
    exportSchema = false
)
abstract class BusinessDatabase : RoomDatabase() {

    companion object : MySingleton<Context, BusinessDatabase>() {

        override val creator: (Context) -> BusinessDatabase
            get() = Companion::createWordDatabase

        private fun createWordDatabase(context: Context): BusinessDatabase {
            return Room.databaseBuilder(context, BusinessDatabase::class.java, "business_database")
                .build()
        }

    }

    //user信息
    abstract fun getUserDao(): UserDao
    //登陆信息
    abstract fun getLoginInfoDao(): LoginInfoDao
    //店铺状态
    abstract fun getShopStatusDao(): ShopStatusDao
    //申请店铺信息

    //

    //

    //

    //

    //

    //

}